home *** CD-ROM | disk | FTP | other *** search
/ Gigantic Games 2 / Gigantic Games 2.iso / pc / _w_ / wanderer / src / wand_head.h < prev   
C/C++ Source or Header  |  1994-12-23  |  5KB  |  197 lines

  1. #include <stdio.h>
  2. #include <curses.h>
  3. #include <string.h>
  4. #include <fcntl.h>
  5.  
  6. /* I wouldnt change these if I were you - it wont give you a bigger screen */
  7. #define ROWLEN 40
  8. #define NOOFROWS 16
  9.  
  10. /* Change these to the necessary directories or files */
  11. #define SCREENPATH "/usr/games/lib/wand/screens"
  12. #define HISCOREPATH "/usr/games/lib/wand/hiscore"
  13. #define LOCKPATH "/tmp/wanderer.lock"      /* hiscore lock file */
  14. #define DICTIONARY "/usr/dict/words"
  15.  
  16. /* change this to anything, but dont forget what */
  17. #define MASTERPASSWORD "squiggly worms"
  18.  
  19. /* change the numbers in this as well, but keep it in the same form */
  20. #define PASSWD (num * num * 4373 + num * 16927 + 39)
  21.  
  22. /* To disable the recording of hiscores from games restored from saves */
  23. /* #define NO_RESTORED_GAME_HISCORES  */
  24. /* #define COMPARE_BY_NAME  define this to compare by name, not uid */
  25. #define GUESTUID 0    /* guestuid always compared by name */
  26. /* #define NO_ENCRYPTION define this to disable the savefile encryptor */
  27. /* cbreak switching via curses package. */
  28. /* on some Ultrix systems you may need to use crmode() and nocrmode() */
  29. /* if so, just change the #defs to the necessary. I also know that Xenix */
  30. /* systems have to use crmode, so.. */
  31. #ifdef XENIX
  32. #define CBON crmode()
  33. #define CBOFF nocrmode()
  34. #else
  35. #define CBON cbreak()
  36. #define CBOFF nocbreak()
  37. #endif
  38.  
  39. /* AMIGA version supports color and sound.  for other versions */
  40. /* the following macros expand to nothing. */
  41. #ifndef AMIGA
  42. #define setcolor(forecolor, backcolor)
  43. #define playSound(whichone)
  44. #define cursor(state)
  45. #endif
  46.  
  47. /* MSDOS modifications (M001) by Gregory H. Margo    */
  48. #ifdef    MSDOS
  49. #define    R_BIN    "rb"    /* binary mode for non-text files */
  50. #define    W_BIN    "wb"
  51. # ifdef    VOIDPTR
  52. #  define VOIDSTAR    (void *)
  53. # else
  54. #  define VOIDSTAR    (char *)
  55. # endif
  56. #define    ASKNAME        /* ask user's name if not in environment */
  57. #define    COMPARE_BY_NAME    /* compare users with name, not uid    */
  58. #undef    getchar        /* remove stdio's definition to use curses'     */
  59. #define    getchar()    getch()    /* use curse's definition instead */
  60.  
  61. #else /* not MSDOS */
  62. #define    R_BIN    "r"
  63. #define    W_BIN    "w"
  64. #define    VOIDSTAR
  65. #endif
  66.  
  67. /* AMIGA modifications by Alan Bland */
  68. #ifdef AMIGA
  69. #undef    SCREENPATH
  70. #undef    HISCOREPATH
  71. #undef    DICTIONARY
  72. #define SCREENPATH "screens"
  73. #define HISCOREPATH "hiscore"
  74. #define    ASKNAME        /* ask user's name if not in environment */
  75. #define    COMPARE_BY_NAME    /* compare users with name, not uid    */
  76. #define NO_ENCRYPTION    /* define this to disable the savefile encryptor */
  77. #define LINT_ARGS    /* Lattice compiler uses ANSI prototypes */
  78. #undef    VOIDSTAR
  79. #define VOIDSTAR    (void *)
  80. #undef    getchar        /* remove stdio's definition to use curses'     */
  81. #define    getchar()    getch()    /* use curse's definition instead */
  82. #define gets(s)        getstr(s) /* curses version */
  83. #include "sounds.h"    /* index into sound table */
  84. #endif
  85.  
  86. /* Save and Restore game additions (M002) by Gregory H. Margo    */
  87. /* mon_rec structure needed by save.c */
  88. struct mon_rec
  89.     {
  90.     int x,y,mx,my;
  91.     char under;
  92.     struct mon_rec *next,*prev;
  93.     };
  94.  
  95.  
  96. struct    save_vars    {
  97.     int    z_x, z_y,
  98.         z_nx, z_ny,
  99.         z_sx, z_sy,
  100.         z_tx, z_ty,
  101.         z_lx, z_ly,
  102.         z_mx, z_my,
  103.         z_bx, z_by,
  104.         z_nbx, z_nby,
  105.         z_max_score,
  106.         z_diamonds,
  107.         z_nf,
  108.         z_hd,
  109.         z_vd,
  110.         z_xdirection,
  111.         z_ydirection;
  112. };
  113.  
  114. /* prototypes added by Gregory H. Margo */
  115. #ifdef    LINT_ARGS    /* M001 */
  116. /* DISPLAY.c */
  117. extern  void map(char (*)[ROWLEN+1]);
  118. extern  void display(int ,int ,char (*)[ROWLEN+1],int );
  119.  
  120. /* EDIT.C */
  121. extern  void instruct(void);
  122. extern  void noins(void);
  123. extern  void editscreen(int ,int *,int *,int ,char *);
  124.  
  125. /* FALL.C */
  126. extern  int check(int *,int *,int ,int ,int ,int ,int ,int ,char *);
  127. extern  int fall(int *,int *,int ,int ,int ,int ,char *);
  128.  
  129. /* GAME.C */
  130. extern  struct mon_rec *make_monster(int ,int );
  131. extern  char *playscreen(int *,int *,int *,int ,char *);
  132.  
  133. /* ICON.C */
  134. extern  void draw_symbol(int ,int ,char );
  135.  
  136. /* JUMP.C */
  137. extern  int scrn_passwd(int ,char *);
  138. extern  void showpass(int );
  139. extern  int jumpscreen(int );
  140. extern  int getnum(void);
  141.  
  142. /* READ.C */
  143. extern  int rscreen(int ,int *);
  144. extern  int wscreen(int ,int );
  145.  
  146. /* SAVE.C */
  147. extern  void save_game(int ,int *,int *,int ,struct mon_rec *,struct mon_rec *);
  148. extern  void restore_game(int *,int *,int *,int *,struct mon_rec *,struct mon_rec **);
  149.  
  150. /* SCORES.C */
  151. extern  int savescore(char *,int ,int ,char *);
  152. extern  void delete_entry(int );
  153. extern  int erase_scores(void);
  154.  
  155. #else
  156.  
  157. /* DISPLAY.c */
  158. extern  void map();
  159. extern  void display();
  160.  
  161. /* EDIT.C */
  162. extern  void instruct();
  163. extern  void noins();
  164. extern  void editscreen();
  165.  
  166. /* FALL.C */
  167. extern  int check();
  168. extern  int fall();
  169.  
  170. /* GAME.C */
  171. extern  struct mon_rec *make_monster();
  172. extern  char *playscreen();
  173.  
  174. /* ICON.C */
  175. extern  void draw_symbol();
  176.  
  177. /* JUMP.C */
  178. extern  int scrn_passwd();
  179. extern  void showpass();
  180. extern  int jumpscreen();
  181. extern  int getnum();
  182.  
  183. /* READ.C */
  184. extern  int rscreen();
  185. extern  int wscreen();
  186.  
  187. /* SAVE.C */
  188. extern  void save_game();
  189. extern  void restore_game();
  190.  
  191. /* SCORES.C */
  192. extern  int savescore();
  193. extern  void delete_entry();
  194. extern  int erase_scores();
  195.  
  196. #endif
  197.